package com.example.testapplication;

import android.os.Bundle;
import android.widget.ListView;

import androidx.annotation.Nullable;

import com.example.testapplication.adapter.MsgAdapter;
import com.example.testapplication.bean.Msg;
import com.example.testapplication.bean.MsgLab;

import java.util.ArrayList;
import java.util.List;

public class CardViewActivity extends ApplicationActivity{
    private ListView mLvMsgList;
    private List<Msg> mDatas = new ArrayList<>();
    private MsgAdapter mAdapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_card);
        mLvMsgList = findViewById(R.id.id_lv_msgList);

        mDatas.addAll(MsgLab.generateMockList());
        mDatas.addAll(MsgLab.generateMockList());

        mAdapter = new MsgAdapter(this, mDatas);
        mLvMsgList.setAdapter(mAdapter);
    }
}
